package com.zzy.factory;
import com.zzy.card.creditCard;
import com.zzy.card.VisaCC;
import com.zzy.com.google.gson.Gson;
public class VisaFactory implements Factory{
	// 单例
    private static VisaFactory visaFactory = null;
    private VisaFactory() {
    }
    public static VisaFactory getFactory() {
        if (visaFactory == null) {
            visaFactory = new VisaFactory();
        }
        return visaFactory;
    }

	@Override
	public creditCard build(String line) {
		// TODO Auto-generated method stub
		Gson gson = new Gson();
        VisaCC shortdata = gson.fromJson(line, VisaCC.class);
        return shortdata;
	}

	@Override
	public creditCard build2() {
		// TODO Auto-generated method stub
		creditCard creditCard = new VisaCC();
        return creditCard;
	}

}
